// 导入用户集合
const { User } = require('../../../model/user');
// 引入分页模块
const pagination = require('mongoose-sex-page')

module.exports = async (req, res) => {
  const { pageIndex, pageSize } = req.query
  const users = await pagination(User).find().page(pageIndex).size(pageSize).exec()
  res.json({
      data: users
  })
}